package com.smartmedical.doctor.medic.controller;

import com.smartmedical.doctor.medic.domain.dto.param.DoctorUserParam;
import com.smartmedical.doctor.medic.domain.vo.DoctorJobTitleVo;
import com.smartmedical.doctor.medic.service.MedicService;
import com.smartmedical.common.core.domain.HealthR;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

//gateway:health/doctor
@RestController
@RequestMapping("/v1")
public class MedicController {

    @Autowired
    MedicService medicService;

    //申请入驻
    @PostMapping("applyJoin")
    public HealthR applyJoin(@RequestBody DoctorUserParam doctorUserParam) {

            return HealthR.ok(medicService.applyJoin(doctorUserParam));
    }

    //发送邮箱验证码
    @PostMapping("sendEmailCode")
    public HealthR sendEmailCode(@RequestParam String email) {

            return HealthR.ok(medicService.sendEmailCode(email));
    }
    //查询系统形象照
    @GetMapping("findSystemImagePic")
    public HealthR<List<String>> findSystemImagePic() {
            return medicService.findSystemImagePic();
    }

    //查询医生职称列表
    @GetMapping("findJobTitleList")
    public HealthR<List<DoctorJobTitleVo>> findJobTitleList() {
            return medicService.findJobTitleList();
    }


    //查询医生职称列表
    @PostMapping("checkCode")
    public HealthR checkCode(@RequestParam String code, @RequestParam String email) {
            return medicService.checkCode(code, email);
    }

    //重置用户密码（忘记密码用）
    @PutMapping("resetUserPwd")
    public HealthR resetUserPwd(@RequestParam String email,@RequestParam String pwd1,@RequestParam String pwd2) {
            return medicService.resetUserPwd(email,pwd1,pwd2);
    }


}
